
#ifndef __TTAAC_H__
#define __TTAAC_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "TTOsalConfig.h"
#include "TTAudio.h"
//#include "M4a.h"

typedef enum {
	TTAAC_NULL_OBJECT		= 0,	
	TTAAC_AAC_MAIN 			= 1,	
	TTAAC_AAC_LC			= 2,	
	TTAAC_AAC_SSR 			= 3,	
	TTAAC_AAC_LTP 			= 4,	
	TTAAC_SBR	 			= 5,					

	TTAAC_ER_AAC_LC			= 17,		
	TTAAC_ER_AAC_LTP		= 19,			
	TTAAC_ER_BSAC			= 22,						
	TTAAC_HE_PS 			= 29,		

	TTAAC_OT_MAX			= TT_MAX_ENUM_VALUE
} TTAACOBJECTTYPE;

// FrameType Support
typedef enum {
	TTAAC_RAWDATA			= 0,	/* FrameType: RawData */
	TTAAC_ADTS				= 1,	/* FrameType: ADTS */
	TTAAC_ADIF				= 2,	/* FrameType: ADIF */
	TTAAC_LATM				= 3,	/* FrameType: LATM */
	TTAAC_LOAS				= 4,	/* FrameType: LOAS */
	TTAAC_FT_MAX			= TT_MAX_ENUM_VALUE
} TTAACFRAMETYPE;

// Channel Configure
typedef enum
{
	TT_AUDIO_CODEC_CHAN_NULL				= 0x0000,		
	TT_AUDIO_CODEC_CHAN_MONO				= 0x0001,		
	TT_AUDIO_CODEC_CHAN_DUALONE				= 0x0002,		
	TT_AUDIO_CODEC_CHAN_DUALMONO			= 0x0010,		
	TT_AUDIO_CODEC_CHAN_DUALLEFT			= 0x0011,		
	TT_AUDIO_CODEC_CHAN_DUALRIGHT			= 0x0012,		
	TT_AUDIO_CODEC_CHAN_STEREO				= 0x0020,		
	TT_AUDIO_CODEC_CHAN_STE2MONO			= 0x0021,		
	TT_AUDIO_CODEC_CHAN_MULTI				= 0x0030,		
	TT_AUDIO_CODEC_CHAN_MULDOWNMIX2			= 0x0031,		
	TT_AUDIO_CODEC_CHAN_CONFIG_MAX			= TT_MAX_ENUM_VALUE
}TT_AUDIO_CODEC_CHANNELCONFIG;

/* AACDec Set Param ID */
#define TT_AACDEC_ID_BASE               	0x02020000
#define TT_AACDEC_PID_PROFILE	 			(TT_AACDEC_ID_BASE | 0x0001)  
#define TT_AACDEC_PID_FRAMETYPE 			(TT_AACDEC_ID_BASE | 0x0002)  
#define TT_AACDEC_PID_CHANNELSPEC 			(TT_AACDEC_ID_BASE | 0x0003)  
#define TT_AACDEC_PID_SELECTCHS				(TT_AACDEC_ID_BASE | 0x0006)  
#define TT_AACDEC_PID_CHANNELMODE 			(TT_AACDEC_ID_BASE | 0x0007)  
#define TT_AACDEC_PID_CHANNELPOSTION		(TT_AACDEC_ID_BASE | 0x0008)  
#define TT_AACDEC_PID_DISABLEAACPLUSV1		(TT_AACDEC_ID_BASE | 0X000B)		
#define TT_AACDEC_PID_DISABLEAACPLUSV2		(TT_AACDEC_ID_BASE | 0X000C)

/* AACDec Return ID */
#define TT_AACDEC_RET_BASE               	0x82020000
#define TT_AACDEC_ERR_AAC_UNSPROFILE		(TT_AACDEC_RET_BASE | 0x0011)
#define TT_AACDEC_ERR_AAC_INVADTS			(TT_AACDEC_RET_BASE | 0x0012)
#define TT_AACDEC_ERR_AAC_INVSTREAM			(TT_AACDEC_RET_BASE | 0x0013)
#define TT_AACDEC_ERR_AAC_INVSBRSTREAM		(TT_AACDEC_RET_BASE | 0x0014)
#define TT_AACDEC_ERR_AAC_FAILDECSBR		(TT_AACDEC_RET_BASE | 0x0015)
#define TT_AACDEC_ERR_OUTPUT_NO_ENOUGH  	(TT_AACDEC_RET_BASE | 0x001c)
#define TT_AACDEC_ERR_AUDIO_UNSCHANNEL		(TT_AACDEC_RET_BASE | 0x0027)
#define TT_AACDEC_ERR_AUDIO_UNSSAMPLERATE	(TT_AACDEC_RET_BASE | 0x0028)
#define TT_AACDEC_ERR_AUDIO_UNSFEATURE		(TT_AACDEC_RET_BASE | 0x0029)

/* AAC Decoder APIs Interface */
DLLEXPORT_C TTInt32 ttGetAACDecAPI (TTAudioCodecAPI * pDecHandle);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif // __TTAAC_H__
